package lab01;

import java.util.Scanner;

/**
 * Created by 14394 on 2017/9/30.
 */
public class Test6 {
    public static void main(String[] args) {
        System.out.println("请输入要使用的方法（a:switch方法  b:if-else方法）：");
        char c=new Scanner(System.in).next().charAt(0);
        if (c=='a') {


            System.out.println("请输入学生成绩绩点：");
            int m = new Scanner(System.in).nextInt();
            switch (m) {
                case 1:
                    System.out.println("不及格");
                    break;
                case 2:
                    System.out.println("及格");
                    break;
                case 3:
                    System.out.println("中等");
                    break;
                case 4:
                    System.out.println("良");
                    break;
                case 5:
                    System.out.println("优秀");
                    break;
            }
        }else if (c=='b'){
            System.out.println("请输入学生成绩绩点：");
            int m = new Scanner(System.in).nextInt();
            if (m==1){
                System.out.println("不及格");
            }else if (m==2){
                System.out.println("及格");
            }else if (m==3){
                System.out.println("中等");
            }else if (m==4){
                System.out.println("良");
            }else {
                System.out.println("优秀");
            }
        }


    }
}
